import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import axios from 'axios'
// 引入字体图标样式
import './assets/fonts/iconfont.css'
// 引入全局样式
import './assets/css/globe.css'

import TreeTable from 'vue-table-with-tree-grid'

// 导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'

import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme

// 引入moment时间戳
import moment from 'moment'
Vue.filter('datefat', function (input, fmtstring) {
  return moment(input).format(fmtstring)
})

axios.defaults.baseURL = 'https://lianghj.top:8888/api/private/v1/'
// 请求拦截
axios.interceptors.request.use((config) => {
  // 为请求头对象，添加token验证的Authorization字段
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
Vue.prototype.$http = axios
// Vue.prototype.$moment = moment
Vue.config.productionTip = false
Vue.component('tree-table', TreeTable)
Vue.use(VueQuillEditor)
new Vue({
  router,
  render: (h) => h(App),
}).$mount('#app')
